package com.example.demo.mapper;

import com.example.demo.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Property;

import java.util.List;

@Mapper
public interface UserMapper {
    List<UserEntity> getAll();
    List<UserEntity> getAllByIdOrder(@Param("ord")String ord);

    //根据id查询用户对象
    UserEntity getUserById(@Param("uid") Integer id);

    UserEntity getUserByUserName(@Param("username") String username);

    UserEntity login(UserEntity user);

    int updatePassword(@Param("id")Integer id, @Param("password")String password,@Param("newPassword")String newPassword);
    int delById(@Param("id") Integer id);

    //添加用户
    int addUser(UserEntity user);

    int addUserGetId(UserEntity user);

    int addUser2(UserEntity user);
    //根据用户名模糊查询
    List<UserEntity> getListByName(@Param("username")String username);


}
